//
// Created by zhouwd on 2019/7/12.
//

#ifndef IPTVSETTING_MEDIA_EXTRACTOR_H
#define IPTVSETTING_MEDIA_EXTRACTOR_H
#include <cstdlib>
#include <cstring>
#include <media/NdkMediaExtractor.h>
#include <android/log.h>
#include "media_audio_decode.h"
#include "media_video_decode.h"
#include "media_render.h"
#include "media_video_frame.h"
#include "media_audio_play.h"
#define LOG_TAG "CAMERA-RENDER"
#define ALOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)

typedef class _MEDIA_EXTRACTOR{
private:
    AMediaExtractor *videoExtractor, *audioExtractor;
    MediaVideoDecode *mediaVideoDecode;
    MediaAudioPlay *mediaAudioPlay;
public:
    _MEDIA_EXTRACTOR();
    ~_MEDIA_EXTRACTOR();
    int init(const char *filename);
    int startExtractor();
    int getVideoWidth();
    int getVideoHeight();
    int initMediaRender(MediaVideoFrame *mediaVideoFrame);
    int destroy();
} MediaExtractor;


#endif //IPTVSETTING_MEDIA_EXTRACTOR_H
